<template>
  <div class="page">
    <div class="main">
      <img :src="require('../../assets/img/orange.png')" />
      <div action="#">
        <input type="text" placeholder="手机号" class="d1" v-model="user.phone" />
        <input type="text " placeholder="输入密码" class="d2" v-model="user.password" />
        <input type="button" class="d3" value="登       录" @click="login" />
      </div>
    </div>
  </div>
</template>
<script>
import {reqLogin} from "../../http/api"
export default {

  data() {
    return {
      user: {
        phone: "",
        password: "",
      },
    };
  },
  methods: {
    toregister() {
      this.$router.push("/register");
    },
    login() {
     reqLogin(this.user).then((res) => {
        // console.log(res);
        if (res.data.code == 200) {
          localStorage.setItem("islogin", true);
          //用户信息
          localStorage.setItem("user",JSON.stringify(res.data.list))
          this.$router.push("/index/home");
        }
      });
    },
  },
};
</script>
<style scoped>
.page {
  max-width: 7.5rem;
  min-width: 3.2rem;
  margin: 0 auto;
}
.tool {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 0.89rem;
  padding: 00.89rem 0.12rem 0 0.34rem;
  background: #ff6040;
}
.tool .back {
  font-size: 0.35rem;
  color: #ffdfd8;
}
.tool p {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font: 0.4rem "微软雅黑";
  color: #ffdfd8;
}
.tool .menu {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 1.72rem;
  height: 0.63rem;
  border: 1px solid #ff866c;
  border-radius: 0.3rem;
}
.tool .menu .line {
  height: 0.37rem;
  width: 1px;
  background: #ff896e;
}
.tool .menu em {
  font-size: 00.35rem;
  color: #ffdfd8;
}
.jiao {
  position: fixed;
  width: 100%;
  left: 0;
  bottom: 0;
  height: 1.17rem;
  border-top: 1px solid #cccccc;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.jiao a {
  display: block;
  text-align: center;
}
.jiao a:first-child p {
  color: #ff6040;
}
.jiao a img {
  height: 0.4rem;
  width: auto;
}
.jiao p {
  font: 0.2rem/0.49rem "微软雅黑";
  color: #9b9b9b;
}
.header {
  background-image: linear-gradient(180deg, #ff6040, #ff7b68);
}
div {
  position: relative;
}
div input {
  width: 3.36rem;
  height: 0.6rem;
  border: 0.02rem solid #e6e6e6;
  background: #ffffff;
  text-indent: 0.67rem;
  border-radius: 0.05rem;
  font: 0.27rem/0.6rem "微软雅黑";
  color: #999999;
}
div .ss {
  position: absolute;
  left: 0.14rem;
  top: 0.15rem;
  color: #9a9a9a;
}
.main {
  margin: 0.2rem;
  position: relative;
  background-color: white;
  /* padding-top: 30%;
  padding-bottom: 43%; */
  padding: 30% 0;
}
.main img {
  height: auto;
  margin-left: 1.72rem;
}
.main div {
  margin-left: 0.5rem;
  display: flex;
  flex-direction: column;
}
.main div .d1 {
  margin-top: 0.9rem;
  width: 6.1rem;
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 0.02rem solid #f7f7f7;
  font: 0.24rem "微软雅黑";
  color: #a8a8a8;
  text-indent: 0.05rem;
}
.main div .d2 {
  margin-top: 0.35rem;
  width: 6.1rem;
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 0.02rem solid #f7f7f7;
  font: 0.24rem "微软雅黑";
  color: #a8a8a8;
  text-indent: 0.05rem;
}
.main div .d3 {
  background-color: #cccccc;
  margin-top: 0.4rem;
  width: 6.1rem;
  height: 1rem;
  color: white;
  text-indent: 0.1rem;
  font-size: 0.3rem;
  font-weight: bold;
}
.main div .d4 {
  background-color: #ff6040;
}
</style>